# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=redfang
pkgver=2.5
pkgrel=6
groups=('blackarch' 'blackarch-bluetooth' 'blackarch-scanner')
pkgdesc="Finds non-discoverable Bluetooth devices by brute-forcing the last six bytes of the devices' Bluetooth addresses and calling read_remote_name()."
arch=('x86_64' 'aarch64')
url='http://packetstormsecurity.com/files/31864/redfang.2.5.tar.gz.html'
license=('custom')
depends=('bluez-libs')
makedepends=('gcc')
source=("https://dl.packetstormsecurity.net/wireless/${pkgname}.${pkgver}.tar.gz")
sha512sums=('c690d9950c089e7893b93434453994617f18d6ae565eca7ec39078f749519ac0fff70d376db2d714c1bf2441eb6cbfeb952cd5e19e62545d00e93dbbf37e11e0')

prepare() {
  cd "$pkgname-$pkgver"

  sed -i '1i#include <linux/limits.h>' fang.c
}

build() {
  cd "$pkgname-$pkgver"

  make
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm 755 fang "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 README "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

